package com.one.blocks.rbac.controller.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.one.blocks.mvc.domain.Id;
import com.one.blocks.mvc.valid.Update;
import com.one.blocks.mvc.valid.UpdateSelective;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Past;
import javax.validation.groups.Default;
import java.io.Serializable;

/**
 * @author <a href="mailto:idler41@163.con">idler41</a> created on 2023-10-25 10:50:39
 */
@ApiModel(value = "系统用户")
@Data
public class SysUserVo implements Id<Integer>, Serializable {
    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    @NotNull(groups = {UpdateSelective.class, Update.class})
    @Null(groups = Default.class)
    private Integer id;
    /**
     * 登录用户名
     */
    @ApiModelProperty(value = "登录用户名")
    @NotNull(groups = {Default.class, Update.class})
    private String username;
    /**
     * 登陆密码
     */
    @ApiModelProperty(value = "登陆密码")
    @NotNull(groups = {Default.class, Update.class})
    private String password;
    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "用户昵称")
    private String nickname;
    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String avatar;
    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    private String mobile;
    /**
     * 性别: 0-男 1-女
     */
    @ApiModelProperty(value = "性别: 0-男 1-女")
    @Range(min = 0, max = 1, groups = {Default.class, Update.class, UpdateSelective.class})
    private Integer gender;
    /**
     * 用户状态: 0-禁用 1-正常 2-锁定
     */
    @ApiModelProperty(value = "用户状态: 0-禁用 1-正常 2-锁定")
    @Range(min = 0, max = 2, groups = {Default.class, Update.class, UpdateSelective.class})
    private Integer state;
    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期")
    @Past(groups = {Default.class, Update.class, UpdateSelective.class})
    private Long birthday;
    /**
     * 创建者id
     */
    @ApiModelProperty(value = "创建者id", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer createId;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long createTime;
    /**
     * 更新者id
     */
    @ApiModelProperty(value = "更新者id", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer updateId;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY)
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long updateTime;
}